package iterator;

public class IteratorMain {
    public static void main(String[] args) {
        ChromeMenu chromeMenu = new ChromeMenu();
        Iterator iterator = chromeMenu.createIterator();
        while(iterator.hasNext()) {
            MenuItem item = iterator.next();
            System.out.printf("[%s] %s\n", item.icon, item.name);
        }
        FirefoxMenu firefoxMenu = new FirefoxMenu();
        firefoxMenu.addItem("检测", "NULL");
        iterator = firefoxMenu.createIterator();
        while(iterator.hasNext()) {
            MenuItem item = iterator.next();
            System.out.printf("[%s] %s\n", item.icon, item.name);
        }
    }
}
